package org.resty.mboot.app.service;

import org.resty.mboot.app.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by ZhanYuan CH on 2016/10/26.
 */
public interface UserJPARepository extends JpaRepository<User, Long> {

    public User findByName(String name);

    public User findByNameAndAge(String name, Integer age);

    @Query("from User u where u.name=:name")
    public User findUser(@Param("name") String name);


}
